/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.dafe.partyband.gui;

import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.swing.AbstractAction;
import org.openide.util.Exceptions;

public final class GoToHelpAction extends AbstractAction {

    private static URI HELP_URI = null;
    
    static {
        try {
            HELP_URI = new URI("http://code.google.com/p/partyband/wiki/UsersGuide");
        } catch (URISyntaxException ex) {
            Exceptions.printStackTrace(ex);
        }
    }

    public void actionPerformed(ActionEvent e) {
        try {
            Desktop.getDesktop().browse(HELP_URI);
        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
        }
    }

    @Override
    public boolean isEnabled() {
        return Desktop.isDesktopSupported() && 
                Desktop.getDesktop().isSupported(Desktop.Action.BROWSE);
    }
    
}
